using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._ModelOnly
{
    /// <summary>
    /// <para>If Row Count Is</para>
    /// <para>Evaluates the row count of the input data and checks whether it matches a specified value.</para>
    /// <para>计算输入数据的行计数，并检查它是否与指定值匹配。</para>
    /// </summary>    
    [DisplayName("If Row Count Is")]
    public class RowCountIfThenElse : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RowCountIfThenElse()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_layer_or_view">
        /// <para>Layer Name or Table View</para>
        /// <para>The input layer or table view to evaluate.</para>
        /// <para>要评估的输入图层或表视图。</para>
        /// </param>
        /// <param name="_count_condition">
        /// <para>Count Condition</para>
        /// <para><xdoc>
        ///   <para>Specifies the condition to be used to test the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Is Equal to—Checks if the row count is equal to the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks if the row count is between the Minimum Count value and Maximum Count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks if the row count is less than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks if the row count is greater than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks if the row count is not equal to the Count value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于测试与 SQL 表达式匹配的记录的字段值的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>等于（Is Equal to） - 检查行计数是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查行计数是否介于“最小计数”（Minimum Count） 值和“最大计数”（Maximum Count） 值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查行计数是否小于计数值。</bullet_item><para/>
        ///     <bullet_item>大于（Is Greater than） - 检查行计数是否大于计数值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查行计数是否不等于计数值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public RowCountIfThenElse(object _in_layer_or_view, _count_condition_value _count_condition)
        {
            this._in_layer_or_view = _in_layer_or_view;
            this._count_condition = _count_condition;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "If Row Count Is";

        public override string CallName => "mb.RowCountIfThenElse";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_layer_or_view, _count_condition.GetGPValue(), _count, _count_min, _count_max, _true, _false];

        /// <summary>
        /// <para>Layer Name or Table View</para>
        /// <para>The input layer or table view to evaluate.</para>
        /// <para>要评估的输入图层或表视图。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Layer Name or Table View")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_layer_or_view { get; set; }


        /// <summary>
        /// <para>Count Condition</para>
        /// <para><xdoc>
        ///   <para>Specifies the condition to be used to test the field values of the records matching the SQL expression.</para>
        ///   <bulletList>
        ///     <bullet_item>Is Equal to—Checks if the row count is equal to the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Between—Checks if the row count is between the Minimum Count value and Maximum Count value.</bullet_item><para/>
        ///     <bullet_item>Is Less Than—Checks if the row count is less than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Greater Than—Checks if the row count is greater than the Count value.</bullet_item><para/>
        ///     <bullet_item>Is Not Equal to—Checks if the row count is not equal to the Count value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于测试与 SQL 表达式匹配的记录的字段值的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>等于（Is Equal to） - 检查行计数是否等于计数值。</bullet_item><para/>
        ///     <bullet_item>介于两者之间 （Is Between） - 检查行计数是否介于“最小计数”（Minimum Count） 值和“最大计数”（Maximum Count） 值之间。</bullet_item><para/>
        ///     <bullet_item>小于（Is Less Than） - 检查行计数是否小于计数值。</bullet_item><para/>
        ///     <bullet_item>大于（Is Greater than） - 检查行计数是否大于计数值。</bullet_item><para/>
        ///     <bullet_item>不等于 - 检查行计数是否不等于计数值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count Condition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _count_condition_value _count_condition { get; set; }

        public enum _count_condition_value
        {
            /// <summary>
            /// <para>Is Equal to</para>
            /// <para>Is Equal to—Checks if the row count is equal to the Count value.</para>
            /// <para>等于（Is Equal to） - 检查行计数是否等于计数值。</para>
            /// </summary>
            [Description("Is Equal to")]
            [GPEnumValue("IS_EQUAL_TO")]
            _IS_EQUAL_TO,

            /// <summary>
            /// <para>Is Between</para>
            /// <para>Is Between—Checks if the row count is between the Minimum Count value and Maximum Count value.</para>
            /// <para>介于两者之间 （Is Between） - 检查行计数是否介于“最小计数”（Minimum Count） 值和“最大计数”（Maximum Count） 值之间。</para>
            /// </summary>
            [Description("Is Between")]
            [GPEnumValue("IS_BETWEEN")]
            _IS_BETWEEN,

            /// <summary>
            /// <para>Is Less Than</para>
            /// <para>Is Less Than—Checks if the row count is less than the Count value.</para>
            /// <para>小于（Is Less Than） - 检查行计数是否小于计数值。</para>
            /// </summary>
            [Description("Is Less Than")]
            [GPEnumValue("IS_LESS_THAN")]
            _IS_LESS_THAN,

            /// <summary>
            /// <para>Is Greater Than</para>
            /// <para>Is Greater Than—Checks if the row count is greater than the Count value.</para>
            /// <para>大于（Is Greater than） - 检查行计数是否大于计数值。</para>
            /// </summary>
            [Description("Is Greater Than")]
            [GPEnumValue("IS_GREATER_THAN")]
            _IS_GREATER_THAN,

            /// <summary>
            /// <para>Is Not Equal to</para>
            /// <para>Is Not Equal to—Checks if the row count is not equal to the Count value.</para>
            /// <para>不等于 - 检查行计数是否不等于计数值。</para>
            /// </summary>
            [Description("Is Not Equal to")]
            [GPEnumValue("IS_NOT_EQUAL_TO")]
            _IS_NOT_EQUAL_TO,

        }

        /// <summary>
        /// <para>Count</para>
        /// <para>The integer count value.</para>
        /// <para>整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count { get; set; } = 0;


        /// <summary>
        /// <para>Minimum Count</para>
        /// <para>The minimum integer count value.</para>
        /// <para>最小整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_min { get; set; } = 0;


        /// <summary>
        /// <para>Maximum Count</para>
        /// <para>The maximum integer count value.</para>
        /// <para>最大整数计数值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Count")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _count_max { get; set; } = 0;


        /// <summary>
        /// <para>True</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("True")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _true { get; set; }


        /// <summary>
        /// <para>False</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("False")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _false { get; set; }


        public RowCountIfThenElse SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}